﻿<UserControl x:Class="Patterns4Net.ArchitectureExplorer.Views.AttributesListView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="200" d:DesignWidth="420">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>

        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
            <ListView Grid.Column="0" Grid.Row="0" ItemsSource="{Binding Items}" SelectedItem="{Binding Path=SelectedItem}">
                <ListView.ItemContainerStyle>
                    <Style TargetType="ListViewItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    </Style>
                </ListView.ItemContainerStyle>
                <ListView.View>
                    <GridView>
                        <GridView.Columns>
                            <GridViewColumn Header="Key" Width="100" DisplayMemberBinding="{Binding Key}"/>
                            <GridViewColumn Header="Value" Width="180" DisplayMemberBinding="{Binding Value}"/>
                        </GridView.Columns>
                    </GridView>
                </ListView.View>
            </ListView>
        </ScrollViewer>

        <StackPanel Grid.Column="1" Grid.Row="0" Margin="20, 5, 10, 5">
            <StackPanel.Resources>
                <Style TargetType="Button">
                    <Setter Property="Margin" Value="0, 4, 0, 0"/>
                </Style>
            </StackPanel.Resources>
            <TextBlock>New item:</TextBlock>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="40"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Grid.Row="0">Key:</TextBlock>
                <TextBox Grid.Column="1" Grid.Row="0" x:Name="NewKey" Width="Auto"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="40"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Grid.Row="0" Width="40">Value:</TextBlock>
                <TextBox Grid.Column="1" Grid.Row="0" x:Name="NewValue"/>
            </Grid>
            <Button x:Name="AddNew">Add new</Button>
            <Button x:Name="Remove">Remove selected</Button>
            <Button x:Name="Reset">Default values</Button>
        </StackPanel>

    </Grid>
</UserControl>
